package cn.通信;

/**
 * @author Mxb
 * @version 1.0
 * @date 2020/7/26 17:17
 */
public class ThreadNum2 extends Thread {
    @Override
    public void run() {
        for (int i = 0; i < 10; i++) {
            synchronized (MyLock.object) {
                System.out.println("2");
                MyLock.object.notify();
                try {
                    MyLock.object.wait();
                } catch (InterruptedException e) {
                    e.printStackTrace();
                }
            }
        }
    }
}
